package com.example._2025_04_03;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/message")
public class MessageController {
    private List<MessageInfo> messageInfoList = new ArrayList<>();
    /*
     *      留言提交
     */
    @RequestMapping(value = "/submit")
    public Boolean submit(@RequestBody MessageInfo messageInfo) {
        messageInfoList.add(messageInfo);
        return true;
    }

    /*
     *      留言列表
     */
    @RequestMapping(value = "/getList")
    public List<MessageInfo> getList() {
        return messageInfoList;
    }
}
